1. Field of the Invention
The present invention relates to a method and apparatus for reproducing data suitable for the reproduction of video data, audio data and the like recorded on an optical disc, magneto-optical disc, or the like.
2. Description of the Related Art
The MPEG (moving picture coding experts group) method has been known as a method for compressing and encoding digital moving picture signals recorded on a digital video disc (hereinafter referred to as DVD). An example of an encoder of this MPEG type will now be described with reference to FIG. 7. In the encoder shown in FIG. 7, a motion detection circuit 101 converts a digitized image input signal into blocks (MB) which are minimum units for prediction for motion compensation, and motion vectors are detected for each block to allow the prediction for motion compensation.
Such blocks are subjected to predictive encoding in a predictive encoding portion which is downstream of the detection circuit. The blocks are classified into (1) intrablocks which are the result of direct DCT (discrete cosine transformation) on the image input signals, (2) forward blocks which are the result of only prediction in the forward direction, (3) backward blocks which are the result of only prediction in the backward direction, and (4) bi-predictive blocks which are the result of prediction in both directions.
In a DCT 103 in this predictive encoding portion, DCT which is a kind of Fourier transformation is performed, and the resultant DCT coefficient is quantized in a quantization circuit 104. After the quantization, variable length encoding is performed in a variable length encoding means 109 wherein codes having different lengths are assigned depending on the probability of occurrence. The quantized signals are subjected to reverse quantization at a reverse quantization circuit 105 and reverse DCT at a reverse DCT 106. Then, the output of a frame memory predictor 108 is added to the signals to reproduce the original image signals. The reproduced image signals are supplied to a subtracter 102 as prediction signals.
The predictive encoding signals output by the variable length encoding means 109 are multiplexed with prediction mode information and motion vector information at a multiplexing means 110. Since such multiplexed data is generated at an irregular rate, it is temporarily accumulated in a buffer 111 to be output at a constant encoding rate. In order to make the average encoding rate constant, control over the amount of code may be carried out by varying a quantization scale factor q of the quantization circuit 104 depending on the amount of the codes accumulated in the buffer 111.
FIG. 8(a) shows the structure for prediction performed between MPEG frames which have been converted into prediction codes. In FIG. 8(a), one GOP (group of pictures) is constituted by, for example, nine frames consisting of one frame of I picture, two frames of P picture and six frames of B picture. A GOP is the unit for encoding which is obtained by dividing one sequence of moving pictures. The I picture is an image obtained by intra-frame predictive encoding. The P picture is an image obtained by inter-frame predictive encoding wherein the temporally preceding frame (I or P picture) which has already been encoded is referred to. The B picture is an image obtained by inter-frame predictive encoding wherein the temporally preceding and succeeding frames are referred to.
Specifically, as indicated by the arrows, an I picture I0 is subjected to predictive encoding only in its frame; a P picture P0 is subjected to inter-frame predictive encoding wherein the I picture I0 is referred to; B pictures B0 and B1 are subjected to inter-frame predictive encoding wherein the I picture I0 and P picture P0 are referred to; and B pictures B2 and B3 are subjected to inter-frame predictive encoding wherein two pictures, i.e., the P pictures P0 and P1 are referred to. Predictive encoding is similarly repeated to create the subsequent pictures.
As to the decoding of pictures which have been subjected to predictive encoding as described above, an I picture can be decoded independently because it has been subjected to intra-frame predictive encoding; the decoding of a P picture involves the temporally preceding I or P picture because it has been subjected to predictive encoding with reference to the temporally preceding I or P picture; and the decoding of a B picture involves the temporally preceding and succeeding I or P pictures because it has been subjected to predictive encoding with reference to the temporally preceding and succeeding I or P pictures. In order to pre-decode the pictures involved in decoding, the pictures are rearranged as shown in FIG. 8(b).
As shown in FIG. 8(b), the rearrangement is carried out such that the I picture I0 precedes B pictures B-1 and B-2 which need the I picture I0 to be decoded; the P picture P0 precedes the B pictures B0 and B1 which need the I picture I0 and P picture P0 to be decoded; and, similarly, the P picture P1 precedes the B pictures B2 and B3 which need the P pictures P0 and P1 to be decoded.
The I, P, and B pictures are recorded on a DVD in the order as shown in FIG. 8(b). Since those pictures have been subjected to predictive encoding as described above, the amount of the codes is not constant for those pictures but varies depending on the complicatedness, flatness, and the like of the images. Those pictures are recorded on the DVD using sectors which are each defined by a predetermined amount of codes. A method of recording utilizing such sectors is shown in FIG. 9 wherein, for example, the I picture I0 is recorded in a sector m, a sector (m+1) and a part of a sector (m+2), and the B picture B-2 is recorded in the remaining area of the sector (m+2) and a sector (m+3). The subsequent pictures are sequentially recorded in sectors. In this example, one GOP is recorded in sectors from sector m through sector (m+13). It is not always true that a GOP is recorded in such a number of sectors. In general, the number of sectors in which one GOP is recorded varies depending on the image because the amount of codes varies depending on the complicatedness and flatness of the image.
FIG. 10 shows an example of a configuration of a disc data reproducing apparatus which reproduces pictures which have been compress-recorded on a disc on an MPEG basis. In FIG. 10, a disc 1-1 is controlled by a spindle motor (not shown) for rotation at a predetermined speed. A pick-up 1-2 directs a laser beam to the track on the disc 1-1 to read the digital data recorded in the track on an MPEG basis. This digital data is demodulated by a demodulation circuit 1-3 and is input to a sector information detection means 2. The output of the pick-up 1-2 is input to a phase-locked loop (PLL) circuit 1-4 which in turn reproduces a clock. The reproduced clock is supplied to the demodulation circuit 1-3.
The digital data on the disc 1 is recorded in sectors each having a fixed length shown in FIG. 9 as described above. Each sector has a sector sync and a sector header at the beginning thereof. In a sector detection circuit 2-1, the boundary between the sectors is detected by detecting the sector sync, and a sector address and the like are detected from the sector header and are supplied to a control circuit 4-1 of a memory means 4. Further, in order to correct errors in the demodulated output, the demodulated output is input to an ECC (error correction circuit) 2-2 through a sector detection circuit 2-1 in which errors are detected and corrected. The error-corrected data is supplied from the ECC 2-2 to a ring buffer memory 4-2 and is written therein under the control of the control circuit 4-1.
Focus and tracking control over the pick-up 1-2 is performed by a tracking servo circuit and a focus servo control circuit according to a focus error signal and a tracking error signal obtained from the information read by the pick-up 1-2 under the control of a system controller. The control circuit 4-1 specifies the address in the ring buffer memory 4-2 into which each sector detected by the sector detection circuit 2-1 is to be written based on the sector address of the sector using a write pointer WP. Further, the control circuit 4-1 specifies the address in the ring buffer memory 4-2 from which data is to be read based on a code request signal supplied by a video code buffer 6-1 provided downstream thereof using a read pointer RP. The data in the position of the read pointer RP is read and is supplied to and stored in the video code buffer 6-1.
The data stored in the video code buffer 6-1 is transferred to a reverse VLC circuit 6-2 in accordance with a code request signal from the reverse VLC circuit 6-2 to be subjected to a reverse VLC process. When the reverse VLC process is complete, the resultant data is supplied to a reverse quantization circuit 6-3, and a code request signal is sent to the video code buffer 6-1 to request the input of new data. The reverse VLC circuit 6-2 also outputs a quantization step size to the reverse quantization circuit 6-3 and outputs motion vectors to a motion compensation circuit 6-6. In the reverse quantization circuit 6-3, the input data is subjected to reverse quantization in accordance with the instructed quantization step size and is output to a reverse DCT circuit 6-4. The reverse DCT circuit 6-4 performs a reverse DCT process on the input data and supplies the result to an adding circuit 6-5.
The adding circuit 6-5 adds the output of the reverse DCT circuit 6-4 and the output of the motion compensation circuit 6-6 depending on the type of the picture (I, P, and B) and outputs the result to a frame memory bank 6-9. Decoded data output by the frame memory bank 6-9 after being rearranged in the initial order of frames as shown in FIG. 8(a) as a result of control over a switch 6-8 is converted into an analog video signal by a digital-to-analog (D-A) converter 6-10 and is displayed on a display 6-11.
Assume that frames recorded in the order as shown in FIG. 8(b) are reproduced. First, when an I picture is decoded, the output of the reverse DCT circuit 6-4 is sent as it is to the frame memory bank 6-9 because this type of picture has not been subjected to inter-frame prediction. In the case of a P or B picture, the decoded I or P picture which has been referred to during predictive encoding of the same is sent from the frame memory bank 6-9 to the motion compensation circuit 6-6, and a motion prediction image is created according to motion vector information supplied by the reverse VLC circuit 6-2 and is supplied to the adding circuit 6-5. In the adding circuit 6-5, the output of the reverse DCT circuit 6-4 is added to the image. The image is thus decoded and is stored in the frame memory bank 6-9.
In response to a code request signal from the video code buffer 6-1, the control circuit 4-1 supplies the data stored in the ring buffer memory 4-2 to the video code buffer 6-1. For example, if data processing on simple pictures continues resulting in a reduction in the amount of the data transferred to the reverse VLC circuit 6-2, the amount of the data transferred from the ring buffer memory 4-2 to the video code buffer 6-1 is also reduced. This increases the amount of the data stored in the ring buffer memory 4-2. This results in a possibility that the write pointer WP gets ahead of the read pointer RP, causing an overflow of the ring buffer 4-2.
This problem is avoided by an arrangement wherein the amount of the data currently stored in the ring buffer memory 4-2 is calculated from the addresses of the write pointer WP and read pointer RP which are controlled by the control circuit 4-2 and, if the amount of data exceeds a predetermined reference value, a track jump determination circuit 7 determines that there is the possibility of an overflow of the ring buffer 4-2 and outputs a track jump command to the circuit 1-5.
Since the rate of the write pointer WP is normally higher than that of the read pointer RP, if the calculated amount of data exceeds a certain level, the write pointer WP is stopped to interrupt writing in order to prevent an overflow. Then, only the read pointer RP is advanced to reduce the amount of remaining data. When the amount of remaining data falls below a preset value, control is performed so that writing is resumed and the write pointer WP is advanced again.
In this case, when the track jump determination circuit 7 outputs the track jump command, the tracking servo circuit 1-5 causes a track jump of the reproduction position of the pick-up 1-2. Specifically, if data is recorded from the side of the inner circumference of the disc 1-1 toward the outer circumference thereof, the pick-up 1-2 jumps from its current position to the next track on the side of the inner circumference. Then, until the reproduction position of the pick-up 1-2 reaches the position before the jump, i.e., until the sector No. obtained from the sector detection circuit 2-1 agrees with the sector No. at the time of the track jump, the writing of new data into the ring buffer memory 4-2 is stopped, and the data in the ring buffer memory 4-2 that is pointed by the read pointer RP is read and transferred to the video code buffer 6-1 as needed.
Even if the sector No. obtained by the sector detection circuit 2-1 after the track jump agrees with the sector No. before the jump, if the amount of the data remaining in the ring buffer memory 4-2 is in excess of a predetermined reference value, the writing of data into the ring buffer memory 4-2 is not resumed and another track jump takes place. The ring buffer memory 4-2 has a memory capacity to allow the storage of data in at least one track (one rotation) of the disc 1-1.
The rate at which data is transferred from the ring buffer memory 4-2 to the video code buffer 6-1 is set to a value equal to or lower than the rate at which data is transferred from the ECC circuit 2-2 to the ring buffer memory 4-2. This allows a code request for the data transfer from the video code buffer 6-1 to the ring buffer memory 4-2 to be freely transmitted regardless of the timing of the track jump. Thus, in the data reproduction apparatus shown in FIG. 10 in which the pick-up 2 makes a track jump in accordance with the memory capacity of the ring buffer memory 4-2, it is possible to prevent an overflow or underflow of the video code buffer 6-1 regardless of the complicatedness and flatness of the reproduction pictures read from the disc 1-1, thereby allowing pictures of uniform image quality to be reproduced for a long period of time.
In a system that handles data compressed using MPEG or the like, the amount of the compressed data generally depends on the complicatedness and flatness of the pictures. Therefore, the compressed data is treated using sectors of a fixed length as described above, or the like. Since the amount of data is thus indefinite, if there are different kinds of data such as I, P, and B pictures and the like as in the case of MPEG, one sector is not necessarily occupied by the same kind of data, and plural kinds of data can exist in one sector. It is therefore necessary to add a particular pattern, information on the attributes of data, and the like to a boundary in a sector at which a kind of data is switched to another.
Thus, a particular pattern is provided in data, and the position and the value of the next data from the pattern may be treated as meaningful information (attribute information). Signal processing at a decoder is performed similarly by detecting a particular pattern. However, when there is an error in reproduction data or the pick-up makes a track jump due to external factors, such a particular pattern can not be detected because data input to a decoder becomes erroneous or discontinuous.
As described above, if synchronization at a decoder is disturbed, there is no means for recovering synchronization other than waiting for the detection of the particular pattern that comes next in the data. This has resulted in a problem in that it takes a long time to recover the normal operation of the system.